import java.io.*;
import java.util.Queue;
import java.util.*;
import java.util.StringTokenizer;

class Solution{
        /**
         * 求最近的完全平方数
         * https://ac.nowcoder.com/acm/problem/205350
         * 解题方法：求x的平方根，取整后的平方与x的差值与
         * 取整 + 1后的平方与x的差值比较获取最近的完全平方数
         */
        public static void main1(String[] args){
            Scanner in = new Scanner(System.in);
            long x = in.nextLong();

            long t = (long)Math.sqrt(x);

            long y = (x - t * t) > ((t + 1) * (t + 1) - x ) ?
                    ((t + 1) * (t + 1)) : t*t;

            System.out.println(y);
        }


        /**
         * 分组：先假设组中最多的人数为x，x的取值范围为0 - N，二分查找
         * 使用hash表统计声部的种类的人数，与check方法搭配使用
         * @param args
         */
        public static void main2_0(String[] args){
            Scanner in = new Scanner(System.in);

            int n = in.nextInt(),m = in.nextInt();

            int hash[] = new int[n + 1];

            for(int i = 0;i < n;i++){
                int x = in.nextInt();
                hash[x]++;
            }
            int min = -1;
            int left = 1,right = n;
            while(left < right){
                int mid = left + (right - left) / 2;
                if(check(hash,mid,m)) right = mid;
                else left = mid + 1;
            }

            if(left != n){
                System.out.println(left);
            }else if(left == n && check(hash,left,m)){
                System.out.println(left);
            }
            else System.out.println(-1);

        }
        private static boolean check(int[] hash,int g,int m){

            int sum = 0;
            for(int x : hash){
                sum += (x / g + (x % g == 0 ? 0 : 1));
            }

            if(sum <= m) return true;
            return false;
        }

        public static void main2_1(String[] args){
            Scanner in = new Scanner(System.in);

            int n = in.nextInt(),m = in.nextInt();

            int hash[] = new int[n + 1];

            int size = 0;
            for(int i = 0;i < n;i++){
                int x = in.nextInt();
                if(hash[x] == 0) size++;
                hash[x]++;
            }

            if(size > m) System.out.println(-1);
            else{
                int left = 1,right = n;
                while(left < right){
                    int mid = left + (right - left) / 2;
                    if(check(hash,mid,m)) right = mid;
                    else left = mid + 1;
                }
                System.out.println(left);
            }
        }

        /**
         * 拓扑排序模板
         * https://www.nowcoder.com/practice/
         * 88f7e156ca7d43a1a535f619cd3f495c?tpId=308&tqId=40470&ru=/exam/oj
         */
    static int n;
    static int m;
    static Map<Integer, List<Integer>> edges = new HashMap<>();
    static Read in = new Read();
    static PrintWriter out = new PrintWriter(new BufferedWriter(
            new OutputStreamWriter(System.out)));

    public static void main(String[] args) throws IOException {

        //预处理
        n = in.nextInt();
        m = in.nextInt();
        int ret[] = new int[n + 1];

        //创建图
        for (int i = 0; i < m; i++) {
            int a = in.nextInt(), b = in.nextInt();
            //如果不存在
            if (!edges.containsKey(a)) {
                edges.put(a, new ArrayList());
            }

            ret[b]++;

            //获取链表将b加入
            edges.get(a).add(b);
        }

        //2.拓扑排序
        Queue<Integer> q = new LinkedList<>();
        for (int i = 1; i <= n; i++) {
            //查找0度点
            if (ret[i] == 0) {
                q.offer(i);
            }
        }

        //3.统计拓扑排序的结果
        int r[] = new int[n];
        int pos = 0;
        while (!q.isEmpty()) {
            int x = q.poll();
            r[pos++] = x;

            for (int t : edges.getOrDefault(x, new ArrayList<>())) {
                ret[t]--;

                if (ret[t] == 0) {
                    q.offer(t);
                }
            }
        }

        //输出
        if (pos == n) {
            for (int i = 0; i < n - 1; i++) {
                out.print(r[i] + " ");
            }
            out.println(r[n - 1]);
        } else
            out.println(-1);


        out.close();
    }

    }

    class Read{
        StringTokenizer st = new StringTokenizer("");//从“"分割字符串
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        //读取一个字符串
        String next() throws  IOException {
            //怕段是否一行已近读取完成
            while(!st.hasMoreTokens()){
                st = new StringTokenizer(br.readLine());//读取一行
            }
            return st.nextToken();//返回字符串
        }

        String nextLine() throws IOException{
            return br.readLine();
        }

        Integer nextInt() throws IOException{
            return Integer.parseInt(next());
        }

        Long nextLong() throws IOException{
            return Long.parseLong(next());
        }

        Float nextFloat() throws IOException{
            return Float.parseFloat(next());
        }

        Double nextDouble() throws IOException{
            return Double.parseDouble(next());
        }
    }
